 AOP = {
            around:function(pointcut,adivce,namespaces){
                if(namespaces == undefined || namespaces.length == 0){
                    //此时返回的namespaces为Window对象
                    namespaces = [(function(){return this;}).call()];
                }
                for(var i in namespaces){
                    var ns = namespaces[i];
                    for(var member in ns){
                        //循环window对象属性.判断是否匹配pointcut
                        if(typeof ns[member] == 'function' && member.match(pointcut)){
                            (function(fn,fnName,ns){
                                //把要切入的函数改变为下面这个函数.从而达到AOP的目的
                                ns[fnName] = function(){
                                  return adivce.call(ns,{fn:fn,fnName:fnName,arguments:arguments});  
                                };
                        
                            })(ns[member],member,ns);
                        }
                    }
                }
            } ,
            before:function(pointcut,advice,namespaces){
                AOP.around(pointcut,function(f){
                    advice.apply(this,f.arguments);
                    return AOP.next(f);
                },namespaces);
            },
            after:function(pointcut,advice,namespaces){
                AOP.around(pointcut,function(f){
                    var ret = AOP.next(f);
                    advice.apply(this,f.arguments);
                    return ret;
                },namespaces);
            },  
            next:function(f){
                return f.fn.apply(this,f.arguments);
            }
        }